package com.columboid.protocol.syncml.tests;

import java.security.NoSuchAlgorithmException;

import junit.framework.TestCase;

import org.junit.Test;

import com.columboid.protocol.syncml.CredentialType;
import com.columboid.protocol.syncml.helper.EncryptionHelper;

public class EncryptionHelperTest extends TestCase {

	@Test
	public void testGetMD5Hashpassword() throws NoSuchAlgorithmException {
		String password = "password";
		String expected = "X03MO1qnZdYdgyfeuILPmQ==";
		String actual = EncryptionHelper.GetHashString("", password, "",
				CredentialType.MD5);
		assertTrue(actual.equals(expected));
	}

	@Test
	public void testGetSHAHashpassword() throws NoSuchAlgorithmException {
		String password = "password";
		String expected = "W6ph5Mm5Pz8GgiULbPgzG37mj9g=";
		String actual = EncryptionHelper.GetHashString("", password, "",
				CredentialType.SHA);
		assertTrue(actual.equals(expected));
	}
}
